package com.cwj.film.controller;

import com.cwj.common.domain.film;
import com.cwj.common.vo.Result;
import com.cwj.common.vo.film.playSo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/play")
public class playController {

    @Resource
    private com.cwj.film.service.inter.play play;
    @Resource
    private HttpServletRequest request;
    @PostMapping("/GetFilmVideos")
    private Result GetFilmVideos(playSo playSo){
        request.setAttribute("playSo",playSo);
        film film = new film();
        BeanUtils.copyProperties(playSo,film);
        List<String> videos = play.GetFilmVideos(film);
        return Result.normal(videos,null);
    }
    @PostMapping("/clickVideoAddRecord")
    private void clickVideoAddRecord(playSo playSo){
        request.setAttribute("playSo",playSo);
             play.clickVideoAddRecord();
    }

}
